﻿@using Amba.ImagePowerTools.Fields
@using Amba.ImagePowerTools.HtmlHelpers
@using System.Linq
@using Amba.ImagePowerTools.Settings
@{
    var field = (ImageMultiPickerField)Model.Field;
    var settings = (ImageMultiPickerFieldSettings)Model.Settings;
}
<style type="text/css">
    .image-item-list-box {
        display:block;
        clear:both;
        width:100%;
        float:left;
    }
    .image-item {
        float:left;
        margin-bottom: 4px;
        margin-top: 4px;
        margin-right:4px;
    }
    .field-info {
        padding-top: 25px;
    }
</style>

@if (field.Images.Any())
{
    <div class="image-item-list-box">
        @foreach (var image in field.Images.Take(4))
        {
            <div class="image-item">
                <a href="@Url.Content("~" + image.FilePath))" target="_blank">
                    @Html.ResizedImage(image.FilePath, height: 60, htmlAttributes: new {alt = "", @class = "pickerimage"}) 
                </a>
            </div>
        }
        
        <div class="field-info">
            @if (field.Images.Count() > 1)
            {
                <text>@T("Images Count"): @(field.Images.Count()) </text>
            }
        </div>
        
        
    </div>
}